<h1>Listing images</h1>

<table>
  <tr>
    <th>Picture</th>
    <th>Notes</th>
    <th>Date taken</th>
    <th>Patient</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @images.each do |image| %>
  <tr>
    <td> <%= image_tag '/patient_images/' + image.id.to_s %> </td>
    <td><%= image.notes %></td>
    <td><%= image.date_taken %></td>
    <td><%= link_to image.Patient.name, patient_path(image.Patient) %></td>
    <td><%= link_to 'Show', image %></td>
    <td><%= link_to 'Edit', edit_image_path(image) %></td>
    <td><%= link_to 'Destroy', image, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Image', new_image_path %>
